package com.wangxiaonan.coupon.domain;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 已领取的优惠券
 *
 * @Author: wangxiaonan
 * @Date: 2019/1/10
 **/
@Entity
@Table(name = "coupon_issue")
@EntityListeners(AuditingEntityListener.class)
public class CouponIssue extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 8100618954875956330L;

    @Id
    @Column(name = "f_id", unique = true, nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @CreatedDate
    @Column(name = "f_created_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createdTime;

    @Column(name = "f_issue_num", unique = true, nullable = false)
    private String issueNum;

    @Column(name = "f_username", nullable = false)
    private String username;

    @Column(name = "f_coupon_info_id")
    private Integer couponInfo;

    /**
     * 使用状态
     */
    @Column(name = "f_status")
    private Integer status;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    public String getIssueNum() {
        return issueNum;
    }

    public void setIssueNum(String issueNum) {
        this.issueNum = issueNum;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Integer getCouponInfo() {
        return couponInfo;
    }

    public void setCouponInfo(Integer couponInfo) {
        this.couponInfo = couponInfo;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }
}
